<template>
  <div id="app" class="adOwner">
    <div class="search">
      <div class="selectOption">
        <el-input v-model="advTitle" placeholder="请输入广告标题"></el-input>
        <el-input v-model="advHomer" placeholder="请输入广告主"></el-input>
        <el-date-picker v-model="value1" type="date" placeholder="请选择广告创建日期" :editable='false'></el-date-picker>
        <el-button type="primary" @click='adverSearch' class='checkBtn'>检索</el-button>
        <el-button type="success" @click='addAdvertisers'> 添加广告</el-button>
      </div>
    </div>
    <!--普通广告列表-->
    <div class="contain_two" style="min-width: 675px;">
      <table class="table table-bordered">
        <thead>
          <tr>
            <th>
              <div class="">
                <span>#</span>
              </div>
            </th>
            <th class=""><span>广告主名称</span></th>

            <th>
              <div class="">
                <span>广告名称</span>
              </div>
            </th>

            <th><span>广告总预算</span></th>

            <th class=""><span>广告投放平台</span></th>
            <th class=""><span>广告位置</span></th>
            <th class=""><span>广告评级</span></th>
            <th><span>创建日期</span></th>
            <th><span>广告状态</span></th>
            <th class=""><span>操作</span></th>
          </tr>
        </thead>
        <tbody id="staff_info" class="">
          <tr class="contLi" v-for="(list,index) in tableData">
            <td>
              <div class=""><span class="">{{index+1}}</span></div>
            </td>
            <td>
              <div class=""><span class="">{{list.name}}</span></div>
            </td>
            <td>
              <div class=""><span class="">{{list.advTitle}}</span></div>
            </td>
            <td>
              <div class=""><span class="">{{list.advTotalPrice|capitalize}}</span></div>
            </td>
            <td>
              <div class=""><span class="">{{list.advPlatform}}</span></div>
            </td>
            <td>
              <div class=""><span class="">{{list.advLocation}}</span></div>
            </td>
            <td>
              <div class=""><span class="">{{list.advGrade}}</span></div>
            </td>
            <td>
              <div class=""><span class="">{{list.createDate}}</span></div>
            </td>
            <td>
              <div class="">
                <span class="">{{list.advStatus}}</span>
                <a id="status" style="margin-left:5px;cursor: pointer;" @click="stoprelease(index)">{{list.status}}</a>
              </div>
            </td>
            <td class="">
              <!--<el-button type="info">详情</el-button>-->
              <el-button type="info" @click="edixindfn(index)">编辑</el-button>
              <el-button type="danger" @click="open2(index)">删除</el-button>
            </td>
          </tr>
        </tbody>
      </table>

      <div class="block pagination" v-show='nullContentPagination'>
        <el-pagination @current-change="handleCurrentChange" :current-page="currentPage" :page-size="10" layout="prev, pager, next, jumper"
          :total="total">
          </el-pagination>
      </div>
      <div class="nullContent" v-show='nullContent'>暂无数据</div>
    </div>
    <!--添加广告弹窗-->
    <div class="tankuang" v-show="adverShow">
      <div class="bomb" style="width: 780px;height: 600px;">
        <div class="bomb_header">
          <p class="bomb_title">添加广告主</p>
          <span @click="closes"><img src="../../assets/images/icon_tanc_close@2x.png" width="10px" height="10"></span>
        </div>
        <div class="bomb_content" style="height:452px;">
          <p>
              <span>广告名称：</span>
              <input style="margin-left: 0;" maxlength="20" type="text" v-model="adname" placeholder="请填写广告名称">
          </p>
          <p style="width:50%;float:left;">
              <span style="float:left;line-height: 30px;">广告主：</span>
              <select v-model="selecteds" id="" style="float: left;margin-left:16px;">
                <option v-for="(option,index) in options" v-bind:value="option.value" @change="adchange">
                  {{ option.text }}
                </option>
              </select>
            </p>
            <!--<div class="clear"></div>-->
            
            <p style="width:50%;float:left;">
              <span style="float:left;line-height: 30px;">广告类型：</span>
              <select class="type_select com-equipment" name="equipment" v-model='adstyle' id="advtype" @change="adlx">
                  <option v-for="option in adstyles" v-bind:value="option.value">
                      {{ option.text }}
                   </option>
              </select>
            </p>
            <p style="width:50%;float:left;">
              <span style="float: left;line-height: 30px;">广告评级：</span>
              <select v-model="advGrade" id="" style="margin-left: 0">
                <option v-for="option in advGrades" v-bind:value="option.value">
                  {{ option.value }}
                </option>
              </select>
            </p>
            <p style="width:50%;float:left;">
              <span style="float:left;line-height: 30px;">广告位置：</span>
              <select v-model="adseat" id="advloca" name="equipment" @change="adwz">
                <option v-for="option in adseats" v-bind:value="option.value">
                  {{ option.text }}
                </option>
              </select>
            </p>
            <div class="clear"></div>
            <p style="float: left;width:100%;">
              <span>跳转地址：</span>
              <input type="text" v-model="advOutLink" placeholder="请输入广告跳转地址">
            </p>
            <div class="clear"></div>
            <p v-show="this.adseat == '1'" style="float: left;width:100%;">
              <span>展示时长：</span>
              <input type="text" v-model="advDuration" placeholder="请输入闪屏广告展示时长（单位：秒）">
            </p>
            <div class="clear"></div>
            <p style="position: relative;float: left;width:100%;">
              <span>广告源：</span>
              <img :src="advLink" alt="" class="logo_img" width="80" height="80" @click="uploads">
              <input type="file" accept="image/jpeg,image/jpg,image/png" name="file" id="logofiles" class="" @change="onFileChange" style="display: none"
              />
              <span class="egRatio">图片上传尺寸比例为：9:16 （建议尺寸:1800*3200 单位：像素）</span>
            </p>
            <div class="clear"></div>
            <p style="float: left;width:100%;">
              <span>备注信息：</span>
              <input type="text" placeholder="请输入备注信息" v-model="remarks">
            </p>
            <div class="clear"></div>
            <p><span style="line-height: 36px;float: left">投放平台：</span>
            <ul class="platform">
              <li><input id="plinp" type="checkbox" value="0" name="" checked="checked"><span>亿点红包</span></li>
            </ul>
            </p>
            <div class="clear"></div>
            <p><span style="font-weight: bold;">投放时间：</span></p>
            <ul class="platform" id="putTime">
              <li style="width: 50%"><span>开始时间：</span>
                <el-date-picker v-model="advStartTime" type="datetime" placeholder="请选择开始日期" :editable='false' clearable></el-date-picker>
              </li>
              <li style="width:50%"><span>结束时间：</span>
                <el-date-picker v-model="advEndTime" type="datetime" placeholder="请选择结束日期" :editable='false' clearable></el-date-picker>
              </li>
            </ul>
            <div class="clear"></div>
            <h4>广告收费设置：</h4>
            <p style="width: 30%;float: left;padding-left: 24px;">
              <input type="radio" name="moneytype" @click="defaultMoneyType" class="moneytype" disabled id="cpaType">
              <span style="width: 100px;">默认收费</span>
            </p>
            <p style="width: 30%;float: left;padding-left: 24px;"><input @click="liulan" type="radio" name="moneytype" class="moneytype" id="cpcType" disabled><span style="width: 100px;">按浏览次数收费</span></p>
            <p style="width: 30%;float: right;padding-left: 24px;"><input @click="dianji" type="radio" name="moneytype" class="moneytype" id="cpmType" disabled><span style="width: 100px;">按点击次数收费</span>
            </p>
            <div class="clear"></div>
            <div class="moneydafault" v-show="moneydafault">
              <p>
                <span>总预算：</span>
                <input style="margin-left: 24px;" v-model="advTotalPrice" type="text" name="" id="" maxlength="9" class="com-budget  advertiser" placeholder="请输入总预算">
              </p>
              <p>
                <span>总展示次数：</span>
                <input v-model="allShowCount" type="text" name="" id="" maxlength="7" class="com-totaltimes  advertiser" placeholder="请输入总展示次数">
              </p>
              <p>
                <span>日展示次数：</span>
                <input v-model="dayShowCount" type="text" name="" id="" maxlength="7" class="com-daytimes  advertiser" placeholder="请输入日展示次数">
              </p>
            </div>
            <div class="clear"></div>
            <div class="needmoney" v-show="needmoney">
              <p style="float: left">
                <span class="needname">总预算：</span>
                <input type="text" name="" id="" maxlength="9" v-model="advTotalPrice" class="com-budget  advertiser" placeholder="请输入广告总预算"
                  width="57%">
              </p>
              <p style="float: left">
                <span class="needname">日上限金额：</span>
                <input type="text" name="" id="daytop" maxlength="7" disabled style="cursor: no-drop" class="com-totalPrice  advertiser"
                  placeholder="功能暂未启用" width="57%">
              </p>
              <div class="clear"></div>
              <p class="price browseunit" v-show="seenmoney">
                <span class="needname">浏览收费标准：</span>
                <input type="text" name="" id="" maxlength="7" v-model="CoptNumber" class="com-dayPriceNum  advertiser" placeholder="请输入浏览次数"
                  width="31%"><b>&nbsp;&nbsp;次&nbsp;&nbsp;</b>
                  <input type="text" name="" id="" maxlength="7" v-model="CoptNumberMoney" class="com-dayPrice  advertiser" placeholder="请输入浏览价格"
                    width="31%"><b>&nbsp;&nbsp;元&nbsp;&nbsp;</b>
              </p>
              <p class="price clickunit" v-show="clickmoney">
                <span class="needname">点击收费标准：</span>
                <input type="text" name="" id="" maxlength="7" v-model="optNumber" class="com-clickPriceNum  advertiser" placeholder="请输入点击次数"><b>&nbsp;&nbsp;次&nbsp;&nbsp;</b>
                <input type="text" name="" id="" maxlength="7" v-model="optNumberMoney" class="com-clickPrice  advertiser" placeholder="请输入点击价格"><b>&nbsp;&nbsp;元&nbsp;&nbsp;</b>
              </p>
            </div>
            <h4>广告定向设置：</h4>
            <div class="dingxiang">
              <p style="width: 50%;float: left;">
                <span>用户年龄：</span>
                <input type="text" v-model="uage" name="" id="" maxlength="5" class="com-age advertiser" placeholder="20-25">
              </p>
              <p style="width: 50%;float: left">
                <span style="float: left;line-height: 30px;">用户性别：</span>
                <select class="type_select com-sex" name="sex" v-model="userSex">
                   <option v-for="option in userSexs" v-bind:value="option.value">
                      {{ option.text }}
                   </option>
                </select>
              </p>
              <div class="clear"></div>
              <p style="width: 50%;float: left;line-height: 36px;">
                <span style="float: left;line-height: 30px;">用户省/市：</span>
                <span id="city_3" class="advertiser" style="display: inline">
                   <span id="procity" style="line-height: 30px;margin-left: 23px;color: #03a9f4;cursor: pointer;" @click="el_show">石家庄</span>
                <el-cascader v-show="cascader" v-model="selectedOptions" expand-trigger="hover" clearable :options="addressData" class='el-input'>
                </el-cascader>
                </span>
              </p>
              <p style="width: 50%;float: left">
                <span style="float: left;line-height: 30px;">用户设备：</span>
                <select class="type_select com-equipment" name="equipment" v-model='userPlatform'>
                  <option v-for="option in userPlatforms" v-bind:value="option.value">
                      {{ option.text }}
                   </option>
                </select>
              </p>
              <p>
                <span class="">用户兴趣&nbsp;&nbsp;</span>
                <input type="checkbox" name="" id="interestAll" @change="checkedAll" />
                <span>全选</span>
              </p>
              <ul class="interest" style="margin-left: 25px;">
                <li v-for="(list,index) in like"><input type="checkbox" :value="list.id" @change="chAll(index)"><span>{{list.dictValue}}</span></li>
              </ul>
            </div>
        </div>
        <div class="bomb_footer">
            <input type="button" v-show="baocun" @click="edixbtn" value="保存"> 
            <input type="button" v-show="tianjia" @click="addSure" value="添加"> 
            <input type="button" @click="cancels" value="取消"> 
        </div>
      </div>
    </div>
  </div>
</template>
<script>
  import {
    mapActions,
    mapState
  } from 'vuex'
  // 导入地址数据 
  import addressData from '../../assets/js/addressData.js'
  // 加载地址数据
  function formatData(data) {
    return data
  }
  export default {
    name: 'adOwner',
    data() {
      return {
      nullContent: false,
       nullContentPagination: true,
        baocun: false,
        tianjia: false,
        remarks: '',
        addressData: formatData(addressData),
        prov: '请选择',
        city: '请选择',
        YXss: [
          {
            value: '请选择',
          }
        ],
        userPlatform: 'IOS,Android',
        userPlatforms: [
          { text: '所有设备', value: 'IOS,Android' },
          { text: 'ios', value: 'IOS' },
          { text: 'Android', value: 'Android' }
        ],
        userSex: 'w,m',
        userSexs: [
          { text: '所有人', value: 'w,m' },
          { text: '女', value: 'w' },
          { text: '男', value: 'm' }
        ],
        advTotalPrice: '',
        seenmoney: true,
        clickmoney: false,
        needmoney: true,
        moneydafault: false,
        advLink: '../../../static/img/icon_xinjian_picture@2x.png',
        advOutLink: '',
        advGrade: 'A级',
        advGrades: [
          { value: 'A级' },
          { value: 'B级' },
        ],
        adname: '',
        selecteds: 'One',
        options: [
          { text: '请选择', value: 'One' },
          // { text: 'Two', value: '亿点红包' },
        ],
        adstyle: '1',
        adstyles: [
          { text: '图片广告', value: '1' },
          { text: '视频广告', value: '2' },
          { text: 'gif广告', value: '3' }
        ],
        adseat: '1',
        adseats: [
          { text: '闪屏广告', value: '1' },
          { text: '内嵌广告', value: '2' },
          { text: '红包广告', value: '3' },
          { text: '首页广告', value: '4' }
        ],
        advHomer: '',
        advTitle: '',
        total: 0,
        currentPage: 1,
        value1: '',
        adverShow: false,
        tableData: [],
        lists: [],
        adId: '',
        adgrade: '',
        advMasterId: '',
        cpmId: '',
        cpaId: '',
        cpcId: '',
        allShowCount: '',
        dayShowCount: '',
        CoptNumber: '',
        CoptNumberMoney: '',
        optNumber: '',
        optNumberMoney: '',
        dirId: '',
        advLocation: '',
        advDuration: '',
        like: [],
        masterId: '',
        selectedOptions: [],
        uage: '',
        cascader: false,
        advStartTime: '',
        advEndTime: '',
      }
    },
    created: function () {
      this.getadOrdinary(1)
      this.getadZhu()
      this.getIntrest()
    },
    filters:{
      capitalize:function(value){
        return value.toFixed(2)
      }
    },
    methods: {
      // 提示
      warning(message, type) {
        this.$message({
          message: message,
          type: type
        });
      },
      // 图片上传
      onFileChange(e) {

        var self = this
        var files = e.target.files || e.dataTransfer.files;
        var fileData = files[0]
        console.log(files)
        //读取图片数据
        var reader = new FileReader();
        if ($('.egRatio').text() == '图片上传尺寸比例为：9:16 （建议尺寸:1800*3200 单位：像素）') {
          reader.onload = function (e) {
            var data = e.target.result;
            //加载图片获取图片真实宽度和高度
            var image = new Image();
            image.onload = function () {
              var width = image.width;
              var height = image.height;
              var m = Number((width / height).toFixed(2))
              var n = Number((9 / 16).toFixed(2))
              if (m !== n) {
                self.warning('请选择正确的图片格式!', 'warning')
                return
              } else {
                self.uploadImage(files[0]);
              }
            };
            image.src = data;
          };
        } else if ($('.egRatio').text() == '图片上传尺寸比例为：2:1 （建议尺寸:2000*1000 单位：像素）') {
          reader.onload = function (e) {
            var data = e.target.result;
            //加载图片获取图片真实宽度和高度
            var image = new Image();
            image.onload = function () {
              var width = image.width;
              var height = image.height;
              var m = parseInt((width / height))
              var n = parseInt((2 / 1))
              console.log(m)
              console.log(n)
              if (m !== n) {
                self.warning('请选择正确的图片格式!', 'warning')
                return
              } else {
                self.uploadImage(files[0]);
              }
            };
            image.src = data;
          };
        } else if ($('.egRatio').text() == '图片上传尺寸比例为：1:1 （建议尺寸:1000*1000 单位：像素）') {
          reader.onload = function (e) {
            var data = e.target.result;
            //加载图片获取图片真实宽度和高度
            var image = new Image();
            image.onload = function () {
              var width = image.width;
              var height = image.height;
              if (width !== height) {
                self.warning('请选择正确的图片格式!', 'warning')
                return
              } else {
                self.uploadImage(files[0]);
              }
            };
            image.src = data;
          };
        } else if ($('.egRatio').text() == '图片上传尺寸比例为：3:4 （建议尺寸:600*800 单位：像素）') {
          reader.onload = function (e) {
            var data = e.target.result;

            // 加载图片获取图片真实宽度和高度
            var image = new Image();
            image.onload = function () {
              var width = image.width;
              var height = image.height;
              var m = parseFloat((width / height).toFixed(2))
              var n = parseFloat((3 / 4).toFixed(2))
              console.log(m)
              console.log(n)
              if (m !== n) {
                self.warning('请选择正确的图片格式!', 'warning')
                return
              } else {
                self.uploadImage(files[0]);
              }
            };
            image.src = data;
          };
        } else if ($('.egRatio').text() == '视频上传格式为MP4') {
          reader.onload = function (e) {
            var data = e.target.result;
            if (fileData.type !== 'video/mp4') {
              self.warning('视频类型必须是.mp4', 'warning')
              return
            } else {
              self.uploadImage(files[0]);
            }
          };
        } else if ($('.egRatio').text() == '图片上传格式为GIF图') {
          reader.onload = function (e) {
            var data = e.target.result;
            if (fileData.type !== 'image/gif') {
              self.warning('请选择正确的图片格式!', 'warning')
              return
            } else {
              self.uploadImage(files[0]);
            }
          };
        }

        reader.readAsDataURL(fileData);
      },
      // 上传图片
      uploadImage(file) {
        var formdata = new FormData();
        formdata.append('token', sessionStorage.token);
        formdata.append('appId', "com_sxluckyking_double");
        formdata.append('file', file);
        formdata.append('appName', 'appName');

        this.uploadFile(formdata).then((data) => {
          console.log(data);
          if (data.code === 200) {
            this.$message({
              message: '上传图片成功',
              type: 'success'
            });
            this.advLink = data.data[0].path;
          } else {
            this.$message.error('上传图片失败');
          }
        }).catch(msg => console.log(msg));
      },
      adlx: function () {
        if (this.adstyle == '1') {
          $('.egRatio').text('图片上传尺寸比例为：9:16 （建议尺寸:1800*3200 单位：像素）')
        } else if (this.adstyle == '2') {
          $('.egRatio').text('视频上传格式为MP4')
        } else if (this.adstyle == '3') {
          $('.egRatio').text('图片上传格式为GIF图')
        }

      },
      adwz: function () {
        if (this.adseat == '1') {
          $('.egRatio').text('图片上传尺寸比例为：9:16 （建议尺寸:1800*3200 单位：像素）')
        } else if (this.adseat == '2') {
          $('.egRatio').text('图片上传尺寸比例为：2:1 （建议尺寸:2000*1000 单位：像素）')
        } else if (this.adseat == '3') {
          $('.egRatio').text('图片上传尺寸比例为：1:1 （建议尺寸:1000*1000 单位：像素）')
        } else if (this.adseat == '4') {
          $('.egRatio').text('图片上传尺寸比例为：3:4 （建议尺寸:600*800 单位：像素）')
        }
      },
      checkedAll: function () {
        if ($('#interestAll').prop('checked') == true) {
          $('.interest li input').prop('checked', true)
        } else {
          $('.interest li input').prop('checked', false)
        }
      },
      chAll(index) {
        console.log($(".interest input[type='checkbox']:checked").length)
        console.log($('.interest input').length)
        if ($(".interest input[type='checkbox']:checked").length == $('.interest input').length) {
          $('#interestAll').prop('checked', true)
        } else {
          $('#interestAll').prop('checked', false)
        }
      },
      el_show: function () {
        $('#procity').hide()
        this.cascader = true
      },
      liulan: function () {
        this.moneydafault = false
        this.needmoney = true
        this.seenmoney = true
        this.clickmoney = false
      },
      dianji: function () {
        this.moneydafault = false
        this.needmoney = true
        this.seenmoney = false
        this.clickmoney = true
      },
      chooseMedicines: function () {
        var valStr = this.prov;
        var arrs = this.addressData;
        var zys = []
        arrs.forEach(function (ele, index) {
          if (ele.value.indexOf(valStr) > -1) {
            var sss = arrs[index].children
            zys = sss;
          }
        })
        this.YXss = zys;
        this.city = zys[0].value
      },
      defaultMoneyType: function () {
        this.moneydafault = true
        this.needmoney = false
      },
      adchange(index) {
        this.masterId = this.options[index].text
      },
      // 获取select下的广告主
      getadZhu() {
        let token = sessionStorage.token;
        this.getadselectlist({
          pageSize: 100,
          pageNo: 1,
          token: token
        }).then((data) => {
          console.log(data, '动态获取广告主');
          if (data.code === 200) {
            for (let i = 0; i < data.data.list.length; i++) {
              this.options.push({ "text": data.data.list[i].name, "value": data.data.list[i].id })
            }
            console.log(this.options)
          } else {
            this.$message(data.message)
          }
        }).catch(msg => console.log(msg));
      },
      // 获取兴趣爱好
      getIntrest() {
        let token = sessionStorage.token;
        this.getIntrestlist({
          dictType: 'interest',
          appId: 'com_sxluckyking_double',
          token: token
        }).then((data) => {
          console.log(data, '动态获取兴趣');
          if (data.code === 200) {
            this.like = data.data[0].children
          } else {
            this.$message(data.message)
          }
        }).catch(msg => console.log(msg));
      },
      // 判断
      panduan() {
        var regs = /^([\u4e00-\u9fa5]+|[a-zA-Z0-9]+)$/
        if (this.selecteds == 'One') {
          this.$message("请选择广告主");
          return false;
        }
        if (this.adname == null || this.adname == "") {
          this.$message("请输入广告名称");
          return false;
        } else if (this.adname.length > 20) {
          this.$message("广告名称不可以超过20个字符");
          return false;
        }else if(!regs.test(this.adname)){
          this.$message('不能输入特殊字符')
          return false;
        }
        if (this.advOutLink == '' || this.advOutLink == null) {
          this.$message("广告跳转地址不能为空");
          return false;
        }
        if (this.advLink == '../../../static/img/icon_xinjian_picture@2x.png') {
          this.$message('请选择广告源')
          return false
        }
        var g = /^[1-9]*[1-9][0-9]*$/;
        var a = /^\d+(\.\d+)?$/
        if (this.adseat == '1') {
          if (this.advDuration == '' || this.advDuration == null) {
            this.$message("请输入闪屏广告展示时长");
            return false;
          }
          if (!g.test(this.advDuration)) {
            this.$message('展示时长只能为正整数')
            return false;
          }
        }
        if ($("#plinp").prop("checked") == false) {
          this.$message("请选择投放平台");
          return false;
        }
        if (this.advStartTime == undefined) {
          this.advStartTime = ''
        }
        if (this.advEndTime == undefined) {
          this.advEndTime = ''
        }
        if (this.advStartTime != '' && this.advEndTime != '') {
          if (new Date(this.advStartTime).getTime() > new Date(this.advEndTime).getTime()) {
            this.$message("开始时间不能大于结束时间");
            return false;
          }
        }
        if (this.advStartTime != '' && this.advEndTime == '') {
          this.$message("请填写结束时间");
          return false;
        }
        if (this.advStartTime == '' && this.advEndTime != '') {
          this.$message("请填写开始时间");
          return false;
        }
        if (new Date(this.advStartTime).getTime() < new Date().getTime()) {
          this.$message("开始时间不能小于当前时间");
          return false;
        }
        if ($("#cpaType").prop("checked") == true) {
          if (this.advTotalPrice == null || this.advTotalPrice == "" || this.advTotalPrice == "0") {
            this.$message("请输入广告总预算");
            return false;
          }
          if (this.allShowCount == null || this.allShowCount == "" || this.allShowCount == "0") {
            this.$message("请输入广告总展示次数");
            return false;
          }
          if (this.dayShowCount == null || this.dayShowCount == "" || this.dayShowCount == "0") {
            this.$message("请输入广告日展示次数");
            return false;
          }
          if (!a.test(this.advTotalPrice)) {
            this.$message('广告预算只能输入非负数')
            return false
          }
          if (!g.test(this.allShowCount)) {
            this.$message('总展示次数只能输入正整数')
            return false
          }
          if (!g.test(this.dayShowCount)) {
            this.$message('日展示次数只能输入正整数')
            return false
          }
          if (parseInt(this.dayShowCount) - parseInt(this.allShowCount) > 0) {
            this.$message("广告日展示次数不能大于广告总展示次数");
            return false;
          }
        } else if ($("#cpcType").prop("checked") == true) {
          if (this.advTotalPrice == null || this.advTotalPrice == "" || this.advTotalPrice == "0") {
            this.$message("请输入广告总预算");
            return false;
          }
          if (this.CoptNumber == null || this.CoptNumber == "" || this.CoptNumber == "0") {
            this.$message("请输入广告浏览标准次数");
            return false;
          }
          if (this.CoptNumberMoney == null || this.CoptNumberMoney == "" || this.CoptNumberMoney == "0") {
            this.$message("请输入广告浏览标准金额");
            return false;
          }
          if (!a.test(this.advTotalPrice)) {
            this.$message('广告预算只能输入非负数')
            return false
          }
          if (!g.test(this.CoptNumber)) {
            this.$message('浏览次数只能输入正整数')
            return false
          }
          if (!a.test(this.CoptNumberMoney)) {
            this.$message('浏览价格只能输入非负数')
            return false
          }
          if (parseFloat(this.CoptNumberMoney) - parseFloat(this.advTotalPrice) > 0) {
            this.$message("广告浏览标准金额不能大于总预算");
            return false;
          }
        } else if ($("#cpmType").prop("checked") == true) {
          if (this.advTotalPrice == null || this.advTotalPrice == "" || this.advTotalPrice == "0") {
            this.$message("请输入广告总预算");
            return false;
          }
          if (this.optNumber == null || this.optNumber == "" || this.optNumber == "0") {
            this.$message("请输入广告点击标准次数");
            return false;
          }
          if (this.optNumberMoney == null || this.optNumberMoney == "" || this.optNumberMoney == "0") {
            this.$message("请输入广告点击标准金额");
            return false;
          }
          if (!a.test(this.advTotalPrice)) {
            this.$message('广告预算只能输入非负数')
            return false
          }
          if (!g.test(this.optNumber)) {
            this.$message('点击次数只能输入正整数')
            return false
          }
          if (!a.test(this.optNumberMoney)) {
            this.$message('点击价格只能输入非负数')
            return false
          }
          if (parseFloat(this.optNumberMoney) - parseFloat(this.advTotalPrice) > 0) {
            this.$message("广告浏览标准金额不能大于总预算");
            return false;
          }
        }
        return true;
      },
      // 添加广告下的  添加按钮
      addSure() {
        var g = /^[1-9]*[1-9][0-9]*$/;
        if (this.panduan() == false) {
          return
        } else {
          this.adgrade = this.advGrade == 'A级' ? '0' : '1'
          console.log($('#cpmType').prop("checked"))
          var startAgeTime = "";
          var start = "";
          var endAgeTime = "";
          var startAge = "";
          if ($(".com-age").val() != "" && $(".com-age").val() != null) {
            if(!g.test($(".com-age").val())){
              this.$message('年龄只能为正整数')
              return
            }else{
            startAge = $(".com-age").val(); //年龄
            console.log(startAge);
            var d = new Date();
            var dataTime = d.getFullYear() + "-" + (d.getMonth() + 1) + "-" + d.getDate();

            if (d.getMonth() < 9 && d.getDate() < 10) {
              startAgeTime = d.getFullYear() - startAge.slice(0, startAge.indexOf("-")) + "/0" + (d.getMonth() + 1) + "/0" + d.getDate() + " 00:00:00";//开始年龄
              start = startAge.indexOf("-") + 1;
              endAgeTime = d.getFullYear() - startAge.slice(start) + "/0" + (d.getMonth() + 1) + "/0" + d.getDate() + " 00:00:00";//结束年龄
            } else if (d.getMonth() < 9) {
              startAgeTime = d.getFullYear() - startAge.slice(0, startAge.indexOf("-")) + "/0" + (d.getMonth() + 1) + "/" + d.getDate() + " 00:00:00";//开始年龄
              start = startAge.indexOf("-") + 1;
              endAgeTime = d.getFullYear() - startAge.slice(start) + "/0" + (d.getMonth() + 1) + "/" + d.getDate() + " 00:00:00";//结束年龄

            } else if (d.getDate() < 10) {
              startAgeTime = d.getFullYear() - startAge.slice(0, startAge.indexOf("-")) + "/" + (d.getMonth() + 1) + "/0" + d.getDate() + " 00:00:00";//开始年龄
              start = startAge.indexOf("-") + 1;
              endAgeTime = d.getFullYear() - startAge.slice(start) + "/" + (d.getMonth() + 1) + "/0" + d.getDate() + " 00:00:00";//结束年龄
            } else {
              startAgeTime = d.getFullYear() - startAge.slice(0, startAge.indexOf("-")) + "/" + (d.getMonth() + 1) + "/" + d.getDate() + " 00:00:00";//开始年龄
              start = startAge.indexOf("-") + 1;
              endAgeTime = d.getFullYear() - startAge.slice(start) + "/" + (d.getMonth() + 1) + "/" + d.getDate() + " 00:00:00";//结束年龄

            }
          }
          }
          var userInterest = ''
          for (var j = 0; j < $(".interest input[type=checkbox]").length; j++) {
            if ($(".interest input[type=checkbox]").eq(j).prop("checked")) {
              userInterest += $(".interest input[type=checkbox]").eq(j).val() + ",";
            }
          }
          var shuju = {
            advertisement: {
              // id:this.adId,
              advTitle: this.adname,
              advGrade: this.adgrade,
              advType: this.adstyle,
              advLink: this.advLink,
              advRemarks: this.remarks,
              advMasterId: this.selecteds,
              advTotalPrice: this.advTotalPrice,
              advPlatform: '0,',
              advLocation: this.adseat,
              advOutLink: this.advOutLink,
              advDuration: this.advDuration,
              // advStartTime: this.advStartTime,
              // advEndTime: this.advEndTime,
            },
            directionalSetting: {
              userPlatform: this.userPlatform,
              userLocation: this.selectedOptions[1],
              startAgeTime: startAgeTime,   //开始年龄
              endAgeTime: endAgeTime,//结束年龄
              userSex: this.userSex,
              userInterest: userInterest,
              // id:this.dirId,
            }
          }
          console.log(this.selectedOptions)
          if (this.advStartTime != '' && this.advEndTime != '') {
            shuju.advertisement.advStartTime = this.UnFormatDates(this.advStartTime)
            shuju.advertisement.advEndTime = this.UnFormatDates(this.advEndTime)
          }
          if ($('#cpaType').prop("checked")) {
            var chargeCpa = {
              // id: this.cpaId,
              allShowCount: this.allShowCount,   //总展示次数
              dayShowCount: this.dayShowCount,   //日展示次数
            };
            shuju.chargeCpa = chargeCpa
          }
          if ($('#cpcType').prop("checked")) {
            var chargeCpc = {
              // id: this.cpcId,
              optNumber: this.CoptNumber,   //展示多少条（浏览）
              optNumberMoney: this.CoptNumberMoney,   //多少钱（浏览）
            };
            shuju.chargeCpc = chargeCpc
          }
          if ($('#cpmType').prop("checked")) {
            var chargeCpm = {
              // id: this.cpmId,
              optNumber: this.optNumber,   //展示多少条（点击）
              optNumberMoney: this.optNumberMoney,   //多少钱（点击）
            };
            shuju.chargeCpm = chargeCpm
          }
          this.adaddlist({
            dataJson: JSON.stringify(shuju),
            token: sessionStorage.token
          }).then((data) => {
            if (data.code == 200) {
              console.log(data, '1211')
              this.cancels()
              this.getadOrdinary(this.currentPage)
            } else {
              this.$message(data.message)
            }
          })
        }
      },
      // 编辑下的 更新信息
      edixbtn() {
        if (this.panduan() == false) {
          return
        } else {
          this.adgrade = this.advGrade == 'A级' ? '0' : '1'
          console.log($('#cpmType').prop("checked"))
          var shuju = {
            advertisement: {
              id: this.adId,
              advTitle: this.adname,
              advType: this.adstyle,
              advGrade: this.adgrade,
              advLink: this.advLink,
              advRemarks: this.remarks,
              advMasterId: this.advMasterId,
              advTotalPrice: this.advTotalPrice,
              advPlatform: '0,',
              advLocation: this.adseat,
              advOutLink: this.advOutLink
            },
            directionalSetting: {
              userPlatform: this.userPlatform,
              userLocation: this.selectedOptions[1],
              startAgeTime: '',
              endAgeTime: '',
              userSex: this.userSex,
              userInterest: '',
              id: this.dirId,
            }
          }
          if ($('#cpaType').prop("checked")) {
            var chargeCpa = {
              id: this.cpaId,
              allShowCount: this.allShowCount,   //总展示次数
              dayShowCount: this.dayShowCount,   //日展示次数
            };
            shuju.chargeCpa = chargeCpa
          }
          if ($('#cpcType').prop("checked")) {
            var chargeCpc = {
              id: this.cpcId,
              optNumber: this.CoptNumber,   //展示多少条（浏览）
              optNumberMoney: this.CoptNumberMoney,   //多少钱（浏览）
            };
            shuju.chargeCpc = chargeCpc
          }
          if ($('#cpmType').prop("checked")) {
            var chargeCpm = {
              id: this.cpmId,
              optNumber: this.optNumber,   //展示多少条（点击）
              optNumberMoney: this.optNumberMoney,   //多少钱（点击）
            };
            shuju.chargeCpm = chargeCpm
          }
          this.edixbtnlist({
            dataJson: JSON.stringify(shuju),
          }).then((data) => {
            if (data.code == 200) {
              console.log(data, '1211')
              this.cancels()
              this.getadOrdinary(this.currentPage)
            } else {
              this.$message(data.message)
            }
          })
        }
      },
      addAdvertisers: function () {
        this.advStartTime = ''
        this.advEndTime = ''
        this.advDuration = ''
        this.uage = ''
        this.selectedOption = []
        this.allShowCount = ''
        this.dayShowCount = ''
        this.tianjia = true
        this.baocun = false
        this.adverShow = true;
        $('.bomb_title').text("添加普通广告")
        this.selecteds = 'One'
        this.adstyle = '1'
        this.adseat = '1'
        this.advGrade = 'A级'
        this.adname = ''
        $("#advloca").removeAttr("disabled"); $("#advtype").removeAttr("disabled");
        this.advOutLink = ''
        this.advLink = '../../../static/img/icon_xinjian_picture@2x.png'
        this.remarks = ''
        this.userSex = 'w,m'
        this.userPlatform = 'IOS,Android'
        this.prov = '请选择'
        $('.moneydafault input').removeAttr('disabled')
        $('#cpaType').removeAttr("disabled");
        $('#cpcType').removeAttr("disabled");
        $('#cpmType').removeAttr("disabled");
        $('#cpcType').prop('checked', true)
        if ($('#cpcType').prop('checked')) {
          this.moneydafault = false
          this.needmoney = true
          this.seenmoney = true
          this.clickmoney = false
        }
        this.optNumber = ''
        this.optNumberMoney = ''
        this.CoptNumber = ''
        this.CoptNumberMoney = ''
        this.advTotalPrice = ''
        $('.needmoney p input').attr('disabled', false)
        $('.moneydafault input').attr('disabled', false)
        $('.needmoney p input').attr('disabled', false)
        $('#daytop').attr('disabled', true)
        $('#procity').hide()
        this.cascader = true
        $('.interest input').prop('checked', false)
        $('#interestAll').prop('checked', false)

      },
      closes: function () {
        this.adverShow = false;
      },
      uploads: function () {
        $("#logofiles").click();
      },
      cancels: function () {
        this.adverShow = false;
      },
      // 请求格式化日期
      UnFormatDate(date) {
        return new Date(date)
      },
      // 请求格式化日期2
      UnFormatDates(date) {
        var y, m, d, h, i, s
        var t = new Date(date)
        y = t.getFullYear()
        m = t.getMonth() + 1
        d = t.getDate()
        h = t.getHours()
        i = t.getMinutes()
        s = t.getSeconds()
        return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d < 10 ? '0' + d : d) + ' '
          + (h < 10 ? '0' + h : h) + ':' + (i < 10 ? '0' + i : i) + ':' + (s < 10 ? '0' + s : s)

      },
      // 请求格式化日期3
      UnFormatDates_3(date) {
        var y, m, d, h, i, s
        var t = new Date(date)
        y = t.getFullYear()
        m = t.getMonth() + 1
        d = t.getDate()
        h = t.getHours()
        i = t.getMinutes()
        s = t.getSeconds()
        return y + '/' + (m < 10 ? '0' + m : m) + '/' + (d < 10 ? '0' + d : d) 

      },
      // 普通广告页面 编辑  
      edixindfn(index) {
        $('#procity').show()
        this.cascader = false
        this.tianjia = false
        this.baocun = true
        this.adverShow = true;
        $('.bomb_title').text("修改普通广告")
        this.edixindfnlist({
          id: this.tableData[index].id
        }).then((data) => {
          if (data.code == 200) {
            // 投放时间
            if (data.data.advertisement.advStartTime != null && data.data.advertisement.advEndTime != null) {
              this.advStartTime = this.UnFormatDate(data.data.advertisement.advStartTime)
              this.advEndTime = this.UnFormatDate(data.data.advertisement.advEndTime)
            } else {
              this.advStartTime = ''
              this.advEndTime = ''
            }
            console.log(data)
            this.selecteds = data.data.advertisement.advMasterId
            this.adname = data.data.advertisement.advTitle
            this.advGrade = data.data.advertisement.advGrade == '0' ? 'A级' : 'B级'
            this.advOutLink = data.data.advertisement.advOutLink
            this.advLink = data.data.advertisement.advLink
            this.advTotalPrice = data.data.advertisement.advTotalPrice
            this.userSex = data.data.directionalSetting.userSex
            this.userPlatform = data.data.directionalSetting.userPlatform
            $('#procity').text(data.data.directionalSetting.userLocation)
            this.remarks = data.data.advertisement.remarks
            this.adId = data.data.advertisement.id
            this.advMasterId = data.data.advertisement.advMasterId
            this.dirId = data.data.directionalSetting.id
            this.advDuration = data.data.advertisement.advDuration
            var userInterest = data.data.directionalSetting.userInterest;//广告投放兴趣
            if (data.data.directionalSetting.startAgeTime != null && data.data.directionalSetting.endAgeTime != null) {
              let e = this.formatDate(data.data.directionalSetting.startAgeTime)
              let d = this.formatDate(data.data.directionalSetting.endAgeTime)
              this.uage = e + '-' + d
            } else {
              this.uage = ''
            }
            $('#cpmType').prop('disabled', true)
            $('#cpaType').prop('disabled', true)
            $('#cpcType').prop('disabled', true)
            if (data.data.chargeCpm != null) {
              $('#cpmType').prop('checked', true)
              this.optNumber = data.data.chargeCpm.optNumber
              this.optNumberMoney = data.data.chargeCpm.optNumberMoney
              this.cpmId = data.data.chargeCpm.id
              this.dianji()
              $('.needmoney p input').attr('disabled', true)
            } else if (data.data.chargeCpa != null) {
              $('#cpaType').prop('checked', true)
              this.allShowCount = data.data.chargeCpa.allShowCount
              this.dayShowCount = data.data.chargeCpa.dayShowCount
              this.cpaId = data.data.chargeCpa.id
              this.defaultMoneyType()
              $('.moneydafault input').attr('disabled', true)
            } else if (data.data.chargeCpc != null) {
              $('#cpcType').prop('checked', true)
              this.cpcId = data.data.chargeCpc.id
              this.CoptNumberMoney = data.data.chargeCpc.optNumber
              this.CoptNumber = data.data.chargeCpc.optNumberMoney
              this.liulan()
              $('.needmoney p input').attr('disabled', true)
            }
            for (var i = 0; i < $('.interest input').length; i++) {
              if (userInterest.indexOf($(".interest input[type=checkbox]").eq(i).val()) != -1) {
                $(".interest input[type=checkbox]").eq(i).prop("checked", true);
              } else {
                $(".interest input[type=checkbox]").eq(i).prop("checked", false);
              }
            }
            if ($(".interest input[type=checkbox]:checked").length == $(".interest input[type=checkbox]").length) {
              $("#interestAll").prop("checked", true);
            } else {
              $("#interestAll").prop("checked", false);
            }
            let type = Number(data.data.advertisement.advLocation)
            switch (type) {
              case 4:
                this.adseat = '4'
                break;
              case 3:
                this.adseat = '3'
                break;
              case 2:
                this.adseat = '2'
                break;
              case 1:
                this.adseat = '1'
                break;
            }


          } else {
            this.$message('error')
          }
        })
      },
      // 格式化日期
      formatDate(date) {
        var y, m, n
        var t = new Date(parseInt(date))
        var m = new Date()
        y = t.getFullYear()
        n = m.getFullYear()
        return Number(n - y)
      },
      //状态暂停和发布
      stoprelease(index) {
        console.log(this.tableData[index].status)
        if (this.tableData[index].status == '暂停') {
          this.stopreleaselist({
            id: this.tableData[index].id
          }).then((data) => {
            if (data.code == 200) {
              console.log(data)
              this.tableData[index].status = '发布'
              this.tableData[index].advStatus = '暂停投放'
            } else {
              this.$message(data.message)
            }
          })
        }
        if (this.tableData[index].status == '发布') {
          this.statreleaselist({
            id: this.tableData[index].id
          }).then((data) => {
            console.log(data)
            if (data.code == 200) {
              console.log(data)
              this.tableData[index].status = '暂停'
              this.tableData[index].advStatus = '正在投放'
            } else {
              this.$message(data.message)
            }
          })
        }

      },
      // 普通广告页面搜索
      adverSearch() {
        var jsonFilter = {};
        if (this.advTitle != "" && this.advTitle != null) {
          jsonFilter.advTitle = this.advTitle;//广告标题
        }
        if (this.advHomer != "" && this.advHomer != null) {
          jsonFilter.name = this.advHomer;//广告主名称
        }
        if (this.value1 != "" && this.value1 != null) {
          jsonFilter.createDate = this.UnFormatDates_3(this.value1) + " 00:00:00";//广告创建开始时间
          jsonFilter.endCreateDate = this.UnFormatDates_3(this.value1) + " 23:59:59";//广告创建结束时间
        }
        this.getadOrdinaryList({
          pageNo: this.currentPage,//当前页码
          pageSize: 10,//总页数
          jsonFilter: JSON.stringify(jsonFilter)
        }).then((data) => {
          if (data.code == 200) {
            console.log(data)
            this.total = data.data.count;
            for (let i = 0; i < data.data.list.length; i++) {
              data.data.list[i].name = data.data.list[i].name;
              data.data.list[i].advTitle = data.data.list[i].advTitle;
              data.data.list[i].advTotalPrice = data.data.list[i].advTotalPrice;
              data.data.list[i].advPlatform = data.data.list[i].advPlatform == '0,' ? '亿点红包' : '';
              data.data.list[i].advGrade = data.data.list[i].advGrade == '0' ? 'A级' : 'B级';
              data.data.list[i].createDate = this.UnFormatDates(data.data.list[i].createDate)
              let type = Number(data.data.list[i].advLocation)
              switch (type) {
                case 4:
                  data.data.list[i].advLocation = '首页广告'
                  break;
                case 3:
                  data.data.list[i].advLocation = '红包广告'
                  break;
                case 2:
                  data.data.list[i].advLocation = '内嵌广告'
                  break;
                case 1:
                  data.data.list[i].advLocation = '闪屏广告'
                  break;
              }
              if (data.data.list[i].advStatus == '1') {
                data.data.list[i].advStatus = '正在投放'
                data.data.list[i].status = '暂停'
              } else {
                data.data.list[i].advStatus = '暂停投放'
                data.data.list[i].status = '发布'
              }
            }
            this.tableData = data.data.list;
          } else {
            this.$message(data.message)
          }

        }).catch(msg => console.log(msg))
      },
      // 普通广告页面删除
      adOrdDel(i) {
        this.adOrdDellist({
          id: this.tableData[i].id,
          token: sessionStorage.token
        }).then((data) => {
          console.log(data)
          if (data.code === 200) {
            this.getadOrdinary(this.currentPage)
          } else {
            this.$message('删除失败')
          }
        }).catch(msg => console.log(msg));
      },
      open2(index) {
        console.log(index)
        console.log(this.tableData[index].id)
        this.$confirm('此操作将永久删除该文件, 是否继续?', '提示', {
          confirmButtonText: '确定',
          cancelButtonText: '取消',
          type: 'warning'
        }).then(() => {
          this.adOrdDel(index)
        }).catch(() => {
          this.$message({
            type: 'info',
            message: '已取消删除'
          });
        });
      },
      // 分页跳转
      handleCurrentChange(val) {
        this.currentPage = val;
        this.getadOrdinary(val);
      },
      // 获取普通广告页面数据
      getadOrdinary(i) {
        this.$store.commit('showLoading');
         var jsonFilter = {};
        if (this.advTitle != "" && this.advTitle != null) {
          jsonFilter.advTitle = this.advTitle;//广告标题
        }
        if (this.advHomer != "" && this.advHomer != null) {
          jsonFilter.name = this.advHomer;//广告主名称
        }
        if (this.value1 != "" && this.value1 != null) {
          jsonFilter.createDate = this.UnFormatDates_3(this.value1) + " 00:00:00";//广告创建开始时间
          jsonFilter.endCreateDate = this.UnFormatDates_3(this.value1) + " 23:59:59";//广告创建结束时间
        }
        let token = sessionStorage.token;
        this.getadOrdinaryList({
          pageSize: 10,
          pageNo: i,
          token: token,
          jsonFilter: JSON.stringify(jsonFilter)
        }).then((data) => {
          this.$store.commit('hiddenLoading');
          console.log(data);
          if (data.code === 200) {
            this.nullContent = false;
          this.nullContentPagination = true;
          if (data.data.list.length == 0) {
              this.nullContent = true;
              this.nullContentPagination = false;
              return;
          }
            this.total = data.data.count;
            for (let i = 0; i < data.data.list.length; i++) {
              data.data.list[i].name = data.data.list[i].name;
              data.data.list[i].advTitle = data.data.list[i].advTitle;
              data.data.list[i].advTotalPrice = data.data.list[i].advTotalPrice;
              data.data.list[i].advPlatform = data.data.list[i].advPlatform == '0,' ? '亿点红包' : '';
              data.data.list[i].advGrade = data.data.list[i].advGrade == '0' ? 'A级' : 'B级';
              data.data.list[i].createDate = this.UnFormatDates(data.data.list[i].createDate)
              let type = Number(data.data.list[i].advLocation)
              switch (type) {
                case 4:
                  data.data.list[i].advLocation = '首页广告'
                  break;
                case 3:
                  data.data.list[i].advLocation = '红包广告'
                  break;
                case 2:
                  data.data.list[i].advLocation = '内嵌广告'
                  break;
                case 1:
                  data.data.list[i].advLocation = '闪屏广告'
                  break;
              }
              if (data.data.list[i].advStatus == '1') {
                data.data.list[i].advStatus = '正在投放'
                data.data.list[i].status = '暂停'
              } else if (data.data.list[i].advStatus == '2') {
                data.data.list[i].advStatus = '暂停投放'
                data.data.list[i].status = '发布'
              }
              if (data.data.list[i].advStatus == '3') {
                data.data.list[i].advStatus = '已下架'
                data.data.list[i].status = ''
              }

            }
            this.tableData = data.data.list;
          } else {
            this.$message(data.message)
          }
        }).catch(msg => console.log(msg));
      },
...mapActions(['getadOrdinaryList','stopreleaselist','statreleaselist','edixindfnlist','edixbtnlist',
      'adOrdDellist','adaddlist','getIntrestlist','getadselectlist','uploadFile'])

    }
  }

</script>
<style scoped>
.bomb_footer input:nth-child(1){
  background: #3C5570;
}
.bomb_footer input:nth-child(2){
  background: #3C5570;
}
.bomb_footer input:nth-child(3){
  background: #DDDDDD;
}  
  .searchAdver p {
    float: left;
    margin: 0 10px;
  }
  
  .searchAdver form input {
    width: 145px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #bfcbd9;
  }
  
  .bomb_content select {
    float: left;
    width: 160px;
    height: 36px;
    border-radius: 4px;
    border: 1px solid #bfcbd9;
    margin-left: 16px;
  }
  
  .add_reward {
    background: rgb(82, 186, 130);
    border-radius: 5px;
    width: 115px;
    height: 36px;
    border: none;
    margin-left: 45px;
    color: #fff;
  }
  
  th,
  td {
    text-align: center;
  }
  
  .tankuang {
    background: rgba(0, 0, 0, 0.5);
    position: fixed;
    overflow: auto;
    z-index: 1500;
    left: 0px;
    top: 0px;
    width: 100%;
    height: 100%;
  }
  
  
  .modal-header {
    border-bottom: none;
    z-index: 1600;
    background: #fff;
    position: fixed;
    width: 946px;
    border-radius: 10px;
  }
  
  .modal-header .close {
    margin-top: -2px;
    margin-right: -13px;
  }
      
  .bomb_content p {
    text-align: left;
    margin: 10px 0;
  }
  
  .bomb_content input[type=text] {
    width: 256px;
    height: 36px;
    margin-left: -5px;
    border-radius: 4px;
    border: 1px solid #bfcbd9;
  }
  
  ::-webkit-input-placeholder {
    color: #bfcbd9;
  }
  
  .bomb_content input[type=file] {
    display: none
  }
  
  .bomb_content img {
    margin-left: 8px;
  }
  
  .egRatio {
    width: 25%;
    top: 0;
    left: 161px;
    position: absolute;
    color: #a5a3a3;
  }
  
  
  .bomb_content .interest,
  .bomb_content .platform {
    /*float: left;*/
    display: inline-block;
    width: calc(100% - 107px);
  }
  
  .bomb_content .platform li,
  .interest li {
    text-align: left;
    width: 20%;
    float: left;
    padding: 8px 0;
  }
  
  h4 {
    border-bottom: 1px solid rgb(229, 229, 229);
    margin-bottom: 12px;
    margin-top: 10px;
    font-size: 14px;
    font-weight: bold;
    text-align: left;
    line-height: 34px;
    padding-bottom: 10px;
  }
  
  .needmoney input {
    width: 50%;
  }
  
  .needmoney input[type=text] {
    width: 57%;
  }
  
  .browseunit input[type=text] {
    width: 31%;
  }
  
  .clickunit input[type=text] {
    width: 31%;
  }
  
  .dingxiang input[type=text] {
    width: 160px;
  }
  
  .interest li {
    width: 20%;
    float: left;
    padding: 10px 0;
  }
  
  .moneydafault p {
    float: left;
    width: 50%;
  }
  
  .moneydafault p input[type=text] {
    width: 60%;
  }
  
  .el-cascader {
    width: 160px!important;
    height: 30px;
    margin-left: -4px;
  }
  
  .el-cascader .el-input {
    height: 30px!important;
  }
  
  table th {
    padding: 0;
    height: 40px;
    line-height: 40px;
  }
  
  .table > tbody > tr {
    padding: 0;
  }
  
  
  /*.table thead{
  background-color: #eef1f6;
}*/
  
  .el-button--success {
    width: 96px;
  }
  
  .el-input {
    width: 200px;
  }
  
  .adOwner {
    width: 100%;
    height: 100%;
    background-color: #fff;
    border-radius: 5px;
  }
  #putTime{
    width:100%;
  }
  .el-date-editor.el-input {
    width: 180px!important;
}
</style>